home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8591 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.ucalgary.ca!krawchuk
  2. From: krawchuk@ensu.ucalgary.ca (Mike Krawchuk)
  3. Newsgroups: comp.lang.c++
  4. Subject: Crappy or what? Oualline's C++ book
  5. Date: 15 Feb 1996 17:28:09 GMT
  6. Organization: Dis
  7. Distribution: world
  8. Message-ID: <KRAWCHUK.96Feb15102809@survey.ensu.ucalgary.ca>
  9. NNTP-Posting-Host: @survey.ensu.ucalgary.ca
  10.  
  11. An instructor in our department asked me to verify some suspicions he
  12. had about a book he was considering using as a text - Practical C++
  13. Programming, by Steve Oualline, published by O'Reilly & Associates Inc.
  14.  
  15. After reading through it, I came to the conclusion that it is unusable.
  16. It is filled with typographical errors, errors of fact, and broken code.
  17.  
  18. As one example, the section on constant pointers (p. 232) is exactly
  19. wrong in its use of const to modify pointers.  The code labelled
  20. incorrect compiles under gcc and Borland C++; the code labelled correct
  21. causes compiler errors.  (as additional verification, Stroustrup's C++
  22. Programming Language also verifies that Oualline is wrong, pp. 68-9)
  23.  
  24. The code provided is:
  25.  
  26.   const char *answer_ptr = "Forty-Two";
  27.  
  28.   answer_ptr = "Fifty-One"; // Oualline says illegal; Stroustrup, gcc says OK
  29.   *answer_ptr = 'X'; // Oualline says legal; Stroustrup, gcc says illegal
  30.  
  31. This is not the only glaring error in the book.  Are we the only ones to
  32. have noticed these errors, or is there some subtle trick we are missing?
  33. The O'Reilly web site doesn't have errata for the book, but I can't
  34. believe everyone else has passed over them!  (we're very disappointed,
  35. as we've used many O'Reilly books in classes before.)
  36.  
  37. Mike
  38.